import sys 
import os
import django



sys.path.append(os.path.dirname(__file__) + os.sep + "../")  # 添加上级目录到环境变量
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "teachzero.settings")  # 处理django环境变量
django.setup()

from service.models import Lesson_note

for i in Lesson_note.objects.all():
    if i.consume==1:
        i.consume=2
        print(i.id,i.title,i.consume)
        i.save()